/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.mad.bikepony.service.persistence;

import com.liferay.portal.service.persistence.BasePersistence;

import com.mad.bikepony.model.Delivery;

/**
 * The persistence interface for the delivery service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author nicola
 * @see DeliveryPersistenceImpl
 * @see DeliveryUtil
 * @generated
 */
public interface DeliveryPersistence extends BasePersistence<Delivery> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link DeliveryUtil} to access the delivery persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the delivery in the entity cache if it is enabled.
	*
	* @param delivery the delivery
	*/
	public void cacheResult(com.mad.bikepony.model.Delivery delivery);

	/**
	* Caches the deliveries in the entity cache if it is enabled.
	*
	* @param deliveries the deliveries
	*/
	public void cacheResult(
		java.util.List<com.mad.bikepony.model.Delivery> deliveries);

	/**
	* Creates a new delivery with the primary key. Does not add the delivery to the database.
	*
	* @param deliveryId the primary key for the new delivery
	* @return the new delivery
	*/
	public com.mad.bikepony.model.Delivery create(long deliveryId);

	/**
	* Removes the delivery with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param deliveryId the primary key of the delivery
	* @return the delivery that was removed
	* @throws com.mad.bikepony.NoSuchDeliveryException if a delivery with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery remove(long deliveryId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	public com.mad.bikepony.model.Delivery updateImpl(
		com.mad.bikepony.model.Delivery delivery, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery with the primary key or throws a {@link com.mad.bikepony.NoSuchDeliveryException} if it could not be found.
	*
	* @param deliveryId the primary key of the delivery
	* @return the delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a delivery with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery findByPrimaryKey(long deliveryId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns the delivery with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param deliveryId the primary key of the delivery
	* @return the delivery, or <code>null</code> if a delivery with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByPrimaryKey(long deliveryId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the deliveries where agentId = &#63; and state = &#63;.
	*
	* @param agentId the agent ID
	* @param state the state
	* @return the matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findByDeliveryStateAndAgentId(
		long agentId, int state)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the deliveries where agentId = &#63; and state = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param agentId the agent ID
	* @param state the state
	* @param start the lower bound of the range of deliveries
	* @param end the upper bound of the range of deliveries (not inclusive)
	* @return the range of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findByDeliveryStateAndAgentId(
		long agentId, int state, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the deliveries where agentId = &#63; and state = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param agentId the agent ID
	* @param state the state
	* @param start the lower bound of the range of deliveries
	* @param end the upper bound of the range of deliveries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findByDeliveryStateAndAgentId(
		long agentId, int state, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first delivery in the ordered set where agentId = &#63; and state = &#63;.
	*
	* @param agentId the agent ID
	* @param state the state
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery findByDeliveryStateAndAgentId_First(
		long agentId, int state,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns the first delivery in the ordered set where agentId = &#63; and state = &#63;.
	*
	* @param agentId the agent ID
	* @param state the state
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryStateAndAgentId_First(
		long agentId, int state,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last delivery in the ordered set where agentId = &#63; and state = &#63;.
	*
	* @param agentId the agent ID
	* @param state the state
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery findByDeliveryStateAndAgentId_Last(
		long agentId, int state,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns the last delivery in the ordered set where agentId = &#63; and state = &#63;.
	*
	* @param agentId the agent ID
	* @param state the state
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryStateAndAgentId_Last(
		long agentId, int state,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the deliveries before and after the current delivery in the ordered set where agentId = &#63; and state = &#63;.
	*
	* @param deliveryId the primary key of the current delivery
	* @param agentId the agent ID
	* @param state the state
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a delivery with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery[] findByDeliveryStateAndAgentId_PrevAndNext(
		long deliveryId, long agentId, int state,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns all the deliveries where agentId = &#63; and state = any &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param agentId the agent ID
	* @param states the states
	* @return the matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findByDeliveryStateAndAgentId(
		long agentId, int[] states)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the deliveries where agentId = &#63; and state = any &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param agentId the agent ID
	* @param states the states
	* @param start the lower bound of the range of deliveries
	* @param end the upper bound of the range of deliveries (not inclusive)
	* @return the range of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findByDeliveryStateAndAgentId(
		long agentId, int[] states, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the deliveries where agentId = &#63; and state = any &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param agentId the agent ID
	* @param states the states
	* @param start the lower bound of the range of deliveries
	* @param end the upper bound of the range of deliveries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findByDeliveryStateAndAgentId(
		long agentId, int[] states, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where deliveryId = &#63; and agentId = &#63; or throws a {@link com.mad.bikepony.NoSuchDeliveryException} if it could not be found.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @return the matching delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery findByDeliveryIdAndAgentId(
		long deliveryId, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns the delivery where deliveryId = &#63; and agentId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryIdAndAgentId(
		long deliveryId, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where deliveryId = &#63; and agentId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryIdAndAgentId(
		long deliveryId, long agentId, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where deliveryId = &#63; and agentId = &#63; and state = &#63; or throws a {@link com.mad.bikepony.NoSuchDeliveryException} if it could not be found.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @param state the state
	* @return the matching delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery findByDeliveryIdAndDeliveryStateAndAgentId(
		long deliveryId, long agentId, int state)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns the delivery where deliveryId = &#63; and agentId = &#63; and state = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @param state the state
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryIdAndDeliveryStateAndAgentId(
		long deliveryId, long agentId, int state)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where deliveryId = &#63; and agentId = &#63; and state = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @param state the state
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryIdAndDeliveryStateAndAgentId(
		long deliveryId, long agentId, int state, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where deliveryId = &#63; and trackingCode = &#63; and agentId = &#63; or throws a {@link com.mad.bikepony.NoSuchDeliveryException} if it could not be found.
	*
	* @param deliveryId the delivery ID
	* @param trackingCode the tracking code
	* @param agentId the agent ID
	* @return the matching delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery findByDeliveryIdAndTrackingCodeAndAgentId(
		long deliveryId, java.lang.String trackingCode, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns the delivery where deliveryId = &#63; and trackingCode = &#63; and agentId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param deliveryId the delivery ID
	* @param trackingCode the tracking code
	* @param agentId the agent ID
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryIdAndTrackingCodeAndAgentId(
		long deliveryId, java.lang.String trackingCode, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where deliveryId = &#63; and trackingCode = &#63; and agentId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param deliveryId the delivery ID
	* @param trackingCode the tracking code
	* @param agentId the agent ID
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryIdAndTrackingCodeAndAgentId(
		long deliveryId, java.lang.String trackingCode, long agentId,
		boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where deliveryId = &#63; and deliveryCode = &#63; and agentId = &#63; or throws a {@link com.mad.bikepony.NoSuchDeliveryException} if it could not be found.
	*
	* @param deliveryId the delivery ID
	* @param deliveryCode the delivery code
	* @param agentId the agent ID
	* @return the matching delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery findByDeliveryIdAndDeliveryCodeAndAgentId(
		long deliveryId, java.lang.String deliveryCode, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns the delivery where deliveryId = &#63; and deliveryCode = &#63; and agentId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param deliveryId the delivery ID
	* @param deliveryCode the delivery code
	* @param agentId the agent ID
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryIdAndDeliveryCodeAndAgentId(
		long deliveryId, java.lang.String deliveryCode, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where deliveryId = &#63; and deliveryCode = &#63; and agentId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param deliveryId the delivery ID
	* @param deliveryCode the delivery code
	* @param agentId the agent ID
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByDeliveryIdAndDeliveryCodeAndAgentId(
		long deliveryId, java.lang.String deliveryCode, long agentId,
		boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where trackingCode = &#63; or throws a {@link com.mad.bikepony.NoSuchDeliveryException} if it could not be found.
	*
	* @param trackingCode the tracking code
	* @return the matching delivery
	* @throws com.mad.bikepony.NoSuchDeliveryException if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery findByTrackingCode(
		java.lang.String trackingCode)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Returns the delivery where trackingCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param trackingCode the tracking code
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByTrackingCode(
		java.lang.String trackingCode)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the delivery where trackingCode = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param trackingCode the tracking code
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching delivery, or <code>null</code> if a matching delivery could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery fetchByTrackingCode(
		java.lang.String trackingCode, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the deliveries.
	*
	* @return the deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the deliveries.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of deliveries
	* @param end the upper bound of the range of deliveries (not inclusive)
	* @return the range of deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findAll(int start,
		int end) throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the deliveries.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of deliveries
	* @param end the upper bound of the range of deliveries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of deliveries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.mad.bikepony.model.Delivery> findAll(int start,
		int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the deliveries where agentId = &#63; and state = &#63; from the database.
	*
	* @param agentId the agent ID
	* @param state the state
	* @throws SystemException if a system exception occurred
	*/
	public void removeByDeliveryStateAndAgentId(long agentId, int state)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes the delivery where deliveryId = &#63; and agentId = &#63; from the database.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @return the delivery that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery removeByDeliveryIdAndAgentId(
		long deliveryId, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Removes the delivery where deliveryId = &#63; and agentId = &#63; and state = &#63; from the database.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @param state the state
	* @return the delivery that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery removeByDeliveryIdAndDeliveryStateAndAgentId(
		long deliveryId, long agentId, int state)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Removes the delivery where deliveryId = &#63; and trackingCode = &#63; and agentId = &#63; from the database.
	*
	* @param deliveryId the delivery ID
	* @param trackingCode the tracking code
	* @param agentId the agent ID
	* @return the delivery that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery removeByDeliveryIdAndTrackingCodeAndAgentId(
		long deliveryId, java.lang.String trackingCode, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Removes the delivery where deliveryId = &#63; and deliveryCode = &#63; and agentId = &#63; from the database.
	*
	* @param deliveryId the delivery ID
	* @param deliveryCode the delivery code
	* @param agentId the agent ID
	* @return the delivery that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery removeByDeliveryIdAndDeliveryCodeAndAgentId(
		long deliveryId, java.lang.String deliveryCode, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Removes the delivery where trackingCode = &#63; from the database.
	*
	* @param trackingCode the tracking code
	* @return the delivery that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.mad.bikepony.model.Delivery removeByTrackingCode(
		java.lang.String trackingCode)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.mad.bikepony.NoSuchDeliveryException;

	/**
	* Removes all the deliveries from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries where agentId = &#63; and state = &#63;.
	*
	* @param agentId the agent ID
	* @param state the state
	* @return the number of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countByDeliveryStateAndAgentId(long agentId, int state)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries where agentId = &#63; and state = any &#63;.
	*
	* @param agentId the agent ID
	* @param states the states
	* @return the number of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countByDeliveryStateAndAgentId(long agentId, int[] states)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries where deliveryId = &#63; and agentId = &#63;.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @return the number of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countByDeliveryIdAndAgentId(long deliveryId, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries where deliveryId = &#63; and agentId = &#63; and state = &#63;.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @param state the state
	* @return the number of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countByDeliveryIdAndDeliveryStateAndAgentId(long deliveryId,
		long agentId, int state)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries where deliveryId = &#63; and agentId = &#63; and state = any &#63;.
	*
	* @param deliveryId the delivery ID
	* @param agentId the agent ID
	* @param states the states
	* @return the number of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countByDeliveryIdAndDeliveryStateAndAgentId(long deliveryId,
		long agentId, int[] states)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries where deliveryId = &#63; and trackingCode = &#63; and agentId = &#63;.
	*
	* @param deliveryId the delivery ID
	* @param trackingCode the tracking code
	* @param agentId the agent ID
	* @return the number of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countByDeliveryIdAndTrackingCodeAndAgentId(long deliveryId,
		java.lang.String trackingCode, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries where deliveryId = &#63; and deliveryCode = &#63; and agentId = &#63;.
	*
	* @param deliveryId the delivery ID
	* @param deliveryCode the delivery code
	* @param agentId the agent ID
	* @return the number of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countByDeliveryIdAndDeliveryCodeAndAgentId(long deliveryId,
		java.lang.String deliveryCode, long agentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries where trackingCode = &#63;.
	*
	* @param trackingCode the tracking code
	* @return the number of matching deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countByTrackingCode(java.lang.String trackingCode)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of deliveries.
	*
	* @return the number of deliveries
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}